home *** CD-ROM | disk | FTP | other *** search
- ;; cmc-kdb.mim -- Cham input method based on Cham keyboard
- ;; Copyright (C) 2008
- ;; National Institute of Advanced Industrial Science and Technology (AIST)
- ;; Registration Number H15PRO112
-
- ;; This file is part of the m17n database; a sub-part of the m17n
- ;; library.
-
- ;; The m17n library is free software; you can redistribute it and/or
- ;; modify it under the terms of the GNU Lesser General Public License
- ;; as published by the Free Software Foundation; either version 2.1 of
- ;; the License, or (at your option) any later version.
-
- ;; The m17n library is distributed in the hope that it will be useful,
- ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- ;; Lesser General Public License for more details.
-
- ;; You should have received a copy of the GNU Lesser General Public
- ;; License along with the m17n library; if not, write to the Free
- ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- ;; Boston, MA 02110-1301, USA.
-
- (input-method cmc kbd)
-
- (description (_"Cham input method simulating Cham keyboard.
- Cham characters are encoded in logical order in memory and in files.
- But, you can type Cham text in visual order with this input method.
- Backspace and Delete also work in the manner of visual order."))
-
- (title "ꨌꩌk")
-
- (map
- ;; Independent vowels and consonants
- (independent
- ;; Vowels
- ("a" "Ω¿Ç")
- ("I" "Ω¿ü")
- ("u" "Ω¿é")
- ("e" "Ω¿â")
- ("i" "Ω¿ä")
- ("o" "Ω¿à")
- ;; Cosonants
- ("k" "Ω¿å")
- ("A" "Ω¿ç")
- ("g" "Ω¿ê")
- ("G" "Ω¿ë")
- ("z" "Ω¿è")
- ("Z" "Ω¿ï")
- ("c" "Ω¿î")
- ("S" "Ω¿ì")
- ("j" "Ω¿ä")
- ("J" "Ω¿Å")
- ("v" "Ω¿É")
- ("V" "Ω¿æ")
- ("W" "Ω¿Æ")
- ("t" "Ω¿ô")
- ("E" "Ω¿ö")
- ("d" "Ω¿ò")
- ("D" "Ω¿û")
- ("n" "Ω¿ù")
- ("q" "Ω¿ÿ")
- ("Q" "Ω¿Ö")
- ("p" "Ω¿Ü")
- ("F" "Ω¿¢")
- ("f" "Ω¿£")
- ("b" "Ω¿¥")
- ("B" "Ω¿₧")
- ("m" "ꨟ")
- ("M" "Ω¿á")
- ("O" "Ω¿í")
- ("y" "Ω¿ó")
- ("r" "Ω¿ú")
- ("l" "Ω¿ñ")
- ("w" "Ω¿Ñ")
- ("x" "ꨦ")
- ("s" "ꨧ")
- ("h" "Ω¿¿"))
- ;; Dependent vowels
- (post-vowel
- ("%" "ꨩ")
- ("^" "ꨩꨮ")
- ("{" "ꨪ")
- ("[" "ꨪꩌ")
- ("}" "Ω¿½")
- ("]" "Ω¿¼")
- ("`" "Ω¿¡")
- ("@" "Ω¿«")
- ("$" "ꨮꩃ")
- ("#" "ꨮꩌ")
- ("<" "ꨱ")
- ("\"" "ꨱꨮ")
- (">" "ꨱꩌ")
- ("," "ꨲ"))
- (pre-vowel
- ("-" "Ω¿»")
- ("=" "ꨰ"))
-
- ;; Medials
- (post-medial
- ("~" "ꨳ")
- ("*" "ꨵ")
- (")" "ꨵꨭ")
- ("(" "ꨵꨶ")
- ("&" "ꨶ"))
-
- (pre-medial
- ("\\" "ꨴ"))
-
- ;; (";" ",")
-
- ;; Final consonants.
- (final
- ("K" "ꩀ")
- ;; ꩁ
- ("U" "ꩂ")
- ("/" "ꩃ")
- ("C" "ꩄ")
- ("T" "ꩅ")
- ("N" "ꩆ")
- ("P" "ꩇ")
- ("Y" "ꩈ")
- ("R" "ꩉ")
- ("L" "ꩊ")
- ("X" "ꩋ")
- ("'" "ꩌ")
- ("H" "ꩍ"))
-
- (misc
- ;; Digits
- ("0" "꩐")
- ("1" "꩑")
- ("2" "꩒")
- ("3" "Ω⌐ô")
- ("4" "Ω⌐ö")
- ("5" "Ω⌐ò")
- ("6" "Ω⌐û")
- ("7" "Ω⌐ù")
- ("8" "Ω⌐ÿ")
- ("9" "Ω⌐Ö")
-
- ;; Traditional punctuations.
- ("_" "꩜")
- ("|" "꩝")
- ("||" "꩞")
- ("|||" "꩟")
-
- ;; ASCII remapping.
- (";" ","))
-
- (edit
- ((BackSpace)
- (set PREV @-1)
- (cond ((= PREV PM)
- (set PREV @-2)
- (cond ((& (>= PREV 0xAA00) (<= PREV 0xAA28))
- (delete @-2) (insert PM))
- (1 (unhandle))))
- ((| (= PREV PV1) (= PREV PV2))
- (cond ((= @-2 PM)
- (cond ((& (>= @-3 0xAA00) (<= @-3 0xAA28))
- (delete @-4)
- (insert PREV) (insert PM))
- (1 (unhandle))))
- ((& (>= @-2 0xAA00) (<= @-2 0xAA28))
- (delete @-2)
- (insert PREV))
- (1 (unhandle))))
- (1 (unhandle))))
-
- ((Delete)
- (set NEXT @+1)
- (cond ((& (>= NEXT 0xAA00) (<= NEXT 0xAA28))
- (set N2 @+2)
- (cond ((= N2 PM)
- (set N3 @+3)
- (cond ((| (= N3 PV1) (= N3 PV2))
- (delete @+3) (insert NEXT) (insert N2))
- (1 (delete @+2) (insert NEXT))))
- ((| (= N2 PV1) (= N2 PV2))
- (delete @+2) (insert NEXT))
- (1 (unhandle))))
- (1 (unhandle)))))
- )
-
- (state
- (init
- (t (set PM 0xAA34) ; PRE-MEDIAL
- (set PV1 0xAA2F) ; PRE-VOWEL-1
- (set PV2 0xAA30) ; PRE-VOWEL-2
- )
-
- (independent
- (set C @-1) (set PREV @-2)
- (cond ((= PREV PM)
- (set PREV @-3)
- (cond ((| (= PREV PV1) (= PREV PV2))
- (delete @-3) (insert C) (insert PM) (insert PREV))
- ((| (< PREV 0xAA00) (> PREV 0xAA28))
- (delete @-2) (insert C) (insert PM))))
- ((| (= PREV PV1) (= PREV PV2))
- (cond ((= @-3 PM))
- ((| (< @-3 0xAA00) (> @-3 0xAA28))
- (delete @-2) (insert C) (insert PREV))))))
-
- (pre-vowel
- (set C @-1) (set NEXT @+1)
- (cond ((& (>= NEXT 0xAA00) (<= NEXT 0xAA28))
- (delete @-1) (delete @+1) (insert NEXT) (insert C) (set NEXT @+1)))
- (cond ((& (>= NEXT 0xAA33) (<= NEXT 0xAA36))
- (delete @-1) (delete @+1) (insert NEXT) (insert C))))
-
- (pre-medial
- (set C @-1) (set NEXT @+1)
- (cond ((& (>= NEXT 0xAA00) (<= NEXT 0xAA28))
- (delete @-1) (delete @+1) (insert NEXT) (insert C))))
-
- (post-medial)
- (post-vowel)
- (final)
- (misc)
- (edit)))
-
- ;; Local Variables:
- ;; coding: utf-8
- ;; mode: emacs-lisp
- ;; End:
-